package com.hl.qzzpbackend.model.dto.user;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * 用户注册请求类
 * @author helong
 */
@Data
@ApiModel(value = "用户注册请求类")
public class UserRegisterRequest implements Serializable {

    /**
     * 账号
     */
    @NotBlank(message = "账号不能为空")
    @Size(min = 6, max = 20, message = "账号长度在6-20位之间")
    @ApiModelProperty(value = "账号")
    private String account;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空")
    @Size(min = 8, max = 16, message = "密码长度在8-16位之间")
    @ApiModelProperty(value = "密码")
    private String password;

    /**
     * 确认密码
     */
    @NotBlank(message = "确认密码不能为空")
    @Size(min = 8, max = 16, message = "确认密码长度在8-16位之间")
    @ApiModelProperty(value = "确认密码")
    private String checkPassword;

    /**
     * 邮箱
     */
    @NotBlank(message = "邮箱不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$")
    @ApiModelProperty(value = "邮箱")
    private String email;

    /**
     * 角色
     */
    @NotNull(message = "角色不能为空")
    @ApiModelProperty(value = "角色")
    private Integer role;
}
